package com.bawei.module_home.goods_act;

import com.bawei.library_base.utils.GlideUtil;
import com.bawei.module_home.R;
import com.bawei.module_home.mvp.Goods;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

import static jp.wasabeef.glide.transformations.RoundedCornersTransformation.CornerType.TOP_LEFT;


/**
 * @author : zhiyu
 * @date : 2021/12/13
 * @content :
 */
public class SearchGoodsAdapter extends BaseQuickAdapter<Goods.DataBean, BaseViewHolder> {
    public SearchGoodsAdapter( @Nullable List<Goods.DataBean> data) {
        super(R.layout.item_search_goods, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, Goods.DataBean dataBean) {
        baseViewHolder.setText(R.id.search_type,dataBean.getLevelOneCategoryName());
        baseViewHolder.setText(R.id.search_name,dataBean.getTitle());
        GlideUtil.getInstance().loadRadImage(getContext(),dataBean.getPictUrl(),baseViewHolder.getView(R.id.search_im),100,TOP_LEFT);
    }
}
